home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / LANG / C / LIB / UNIXLIB37B / !UnixLib37 / src / unix / c / pathconf < prev    next >
Text File  |  1996-11-09  |  2KB  |  112 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/unix/c/RCS/pathconf,v $
  4.  * $Date: 1996/10/30 22:02:47 $
  5.  * $Revision: 1.1 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: pathconf,v $
  10.  * Revision 1.1  1996/10/30 22:02:47  unixlib
  11.  * Initial revision
  12.  *
  13.  ***************************************************************************/
  14.  
  15. static const char rcs_id[] = "$Id: pathconf,v 1.1 1996/10/30 22:02:47 unixlib Rel $";
  16.  
  17. /* unix.c.pathconf. Return filing system implementation details.
  18.  
  19.    Written by Nick Burrett, 13 October 1996.  */
  20.  
  21. #include <errno.h>
  22. #include <limits.h>
  23. #include <unistd.h>
  24. #include <stddef.h>
  25.  
  26. /* These functions are stub varieties that need a proper
  27.    implementation.  */
  28.  
  29. long int
  30. pathconf (const char *filename, int parameter)
  31. {
  32.   filename = filename;
  33.  
  34.   switch (parameter)
  35.     {
  36.     default:
  37.       errno = EINVAL;
  38.       return -1;
  39.  
  40.     case _PC_LINK_MAX:
  41. #ifdef LINK_MAX
  42.       return LINK_MAX;
  43. #else
  44.       return -1;
  45. #endif
  46.  
  47.     case _PC_MAX_CANON:
  48. #ifdef MAX_CANON
  49.       return MAX_CANON;
  50. #else
  51.       return -1;
  52. #endif
  53.  
  54.     case _PC_MAX_INPUT:
  55. #ifdef MAX_INPUT
  56.       return MAX_INPUT;
  57. #else
  58.       return -1;
  59. #endif
  60.  
  61.     case _PC_NAME_MAX:
  62. #ifdef NAME_MAX
  63.       return NAME_MAX;
  64. #else
  65.       return -1;
  66. #endif
  67.  
  68.     case _PC_PATH_MAX:
  69. #ifdef PATH_MAX
  70.       return PATH_MAX;
  71. #else
  72.       return -1;
  73. #endif
  74.  
  75.     case _PC_PIPE_BUF:
  76. #ifdef PIPE_BUF
  77.       return PIPE_BUF;
  78. #else
  79.       return -1;
  80. #endif
  81.  
  82.     case _PC_CHOWN_RESTRICTED:
  83. #ifdef _POSIX_CHOWN_RESTRICTED
  84.       return _POSIX_CHOWN_RESTRICTED;
  85. #else
  86.       return -1;
  87. #endif
  88.  
  89.     case _PC_NO_TRUNC:
  90. #ifdef _POSIX_NO_TRUNC
  91.       return _POSIX_NO_TRUNC;
  92. #else
  93.       return -1;
  94. #endif
  95.  
  96.     case _PC_VDISABLE:
  97. #ifdef _POSIX_VDISABLE
  98.       return _POSIX_VDISABLE;
  99. #else
  100.       return -1;
  101. #endif
  102.     }
  103. }
  104.  
  105. long int
  106. fpathconf (int fd, int selection)
  107. {
  108.   fd = fd;
  109.  
  110.   return pathconf (0, selection);
  111. }
  112.